class Solution {
public:
    bool isPerfectSquare(int num) {
        long square=1;
        for(long i=1;i<=num/2+1;i++){
            square=i *i;
            if(square==num)return true;
        }

        return false;
    }
};
